<!-- subpkg_consult/order_list/components/order-list.vue -->
<script lang="ts" setup>
  import { ref } from 'vue'
  import List from './components/list.vue'

  // 标签索引值
  const tabIndex = ref(1)
  // 标签页数据

  const orderTabs = ref([
    { label: '问医生', rendered: false },
    { label: '极速问诊', rendered: true },
    { label: '开药问诊', rendered: false },
  ])

  const onChangeTab = (index: number) => {
    tabIndex.value = index
    orderTabs.value[index].rendered = true
  }
</script>

<template>
  <custom-tabs :data="orderTabs" @change="onChangeTab" />
  <view v-for="(item, index) in orderTabs" v-show="tabIndex === index">
    <List :type="index + 1 + ''" v-if="item.rendered" />
  </view>
</template>
